#ifndef STRUCTMESHOVERLAP_HPP
#define STRUCTMESHOVERLAP_HPP

namespace hms
{

/** @brief Holds data to address 1D overlaps with other partitions. */
struct OverlapSegment {
	/** @brief Rank of the target partition */
	int rank;
	/** @brief Number of cells/elements overlapping with the target partition */
	Index size;
	/** @brief Offset in x from the leftmost element of the target partition */
	Index beg;
	/** @brief Offset in x from the leftmost element of the executing node */
	Index ownBeg;
};

/**
 * @brief Represents a 2D block of data, e.g. cells of a mesh. Returned by 
 * overlappingBlocks() and intended for use in redistribution of field-like data
 * after rebalancing.
 */
struct OverlapBlock {
	/** @brief Target rank */
	Index rank;
	/** @brief Minimum x-y-indices in respect to the global mesh */
	Array2i begin;
	/** @brief Number of cells in x- and y-direction */
	Array2i size;
};

} // end namespace hms


#endif